package com.example.myapplication1;

import android.os.Bundle;
import android.util.Log;
import android.widget.ImageButton;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;

public class LibraryActivity extends AppCompatActivity {
    private static final String TAG = "LibraryActivity";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        try {
            super.onCreate(savedInstanceState);
            Log.d(TAG, "正在创建图书馆页面");
            setContentView(R.layout.activity_library);

            // 设置返回按钮
            ImageButton backButton = findViewById(R.id.back_button);




            if (backButton != null) {
                backButton.setOnClickListener(v -> finish());
            } else {
                Log.e(TAG, "找不到返回按钮");
            }
        } catch (Exception e) {
            Log.e(TAG, "创建图书馆页面时出错: " + e.getMessage());
            Toast.makeText(this, "页面加载失败", Toast.LENGTH_SHORT).show();
            finish();
        }
    }

    @Override
    protected void onStart() {
        super.onStart();
        Log.d(TAG, "图书馆页面已启动");
    }
} 